<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:75:"D:\fangcms\fangcms_city_add\public/../application/manage\view\menu\add.html";i:1474529494;}*/ ?>
<!--菜单添加-->
<div class="dialog_content">
	<form id="info_form" name="info_form" action="<?php echo url('Menu/addDo'); ?>" method="post">
    <table width="100%" class="table_form">
    	<tr>
          <th width="100">上级菜单 :</th>
          <td>
          	<select name="pid">
            	<option value="0">作为一级菜单</option>
            	<?php echo $select_menus; ?>
            </select>
          </td>
        </tr>
        <tr>
          <th>菜单名称 :</th>
          <td><input type="text" name="name" id="name" class="input-text"></td>
        </tr>
        <tr>
          <th>控制器名 :</th>
          <td><input type="text" name="module_name" id="module_name" class="input-text"></td>
        </tr>
        <tr>
          <th>方法名 :</th>
          <td><input type="text" name="action_name" id="action_name" class="input-text"></td>
        </tr>
        <tr> 
          <th>附加参数 :</th>
          <td><input type="text" name="data" id="data" class="input-text"></td>
        </tr>
        <tr>
          <th>备注 :</th>
          <td><textarea name="remark" id="remark" cols="40" rows="3"></textarea></td>
        </tr>
        <tr>
          <th>是否显示 :</th>
          <td>
            <label><input type="radio" name="display" class="radio_style" value="1" checked="checked"> 是&nbsp;&nbsp;</label>
            <label><input type="radio" name="display" class="radio_style" value="0"> 否</label>
          </td>
        </tr>
    </table>
    </form>
</div>
<script>
$(function(){
    
	$.formValidator.initConfig({formid:"info_form",autotip:true});

    $("#name").formValidator({ onshow:'填写菜单名称', onfocus:'填写菜单名称', oncorrect:'正确'}).inputValidator({ min:1, onerror:'填写菜单名称'});
    $("#module_name").formValidator({ onshow:'填写控制器名', onfocus:'填写控制器名', oncorrect:'正确'}).inputValidator({ min:1, onerror:'填写控制器名'});
    $("#action_name").formValidator({ onshow:'填写方法名', onfocus:'填写方法名', oncorrect:'正确'}).inputValidator({ min:1, onerror:'填写方法名'});

    $('#info_form').ajaxForm({success:complate,dataType:'json'});
	function complate(result){
		if(result.status == 1){
			$.dialog.get(result.dialog).close();
			$.yingloujie.tip({content:result.msg});
            setTimeout(function(){window.location.reload();},1000);
		} else {
			$.yingloujie.tip({content:result.msg, icon:'alert'});
		}
	}
})
</script>